#ifndef MESSAGE_H
#define MESSAGE_H

#include <QObject>
#include<QDate>
class Message : public QObject
{
    Q_OBJECT
    Q_ENUMS(MESSAGE_COLOR)
    Q_PROPERTY(QString author READ author WRITE setAuthor NOTIFY authorChanged)
public:
    enum MESSAGE_COLOR {
            MESSAGE_COLOR_YELLOW,
            MESSAGE_COLOR_RED,
            MESSAGE_COLOR_BLUE,
            MESSAGE_COLOR_ALL
        };
    explicit Message(QObject *parent = nullptr);
    void setAuthor(const QString &);
    QString author()const;
    Q_INVOKABLE bool postMessage(const QString &);
signals:
    void authorChanged();
    void sendresfresh(QDate sendvalue);

public slots:
    void refresh();
    void qmlToCppSlot(QString );
    void doSomeThing(MESSAGE_COLOR messageColor);
private:
    QString m_author;
};

#endif // MESSAGE_H
